//
// Created by shen on 2024/10/30.
//

#ifndef CROSSPLATFORMPLAYER_LOG_H
#define CROSSPLATFORMPLAYER_LOG_H
#include <sys/time.h>
#include <glog/logging.h>


//添加以下代码
#ifdef __ANDROID__
#include <android/log.h>
#define LOG_TAG    "native-log"
#define LOGI(...)  __android_log_print(ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__)
#define LOGE(...)  __android_log_print(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__)
#define LOGD(...)  __android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)
#define LOGW(...)  __android_log_print(ANDROID_LOG_WARN, LOG_TAG, __VA_ARGS__)
#define LOGV(...)  __android_log_print(ANDROID_LOG_VERBOSE, LOG_TAG, __VA_ARGS__)
#endif


static long long GetSysCurrentTime()
{
    struct timeval time;
    gettimeofday(&time, NULL);
    long long curTime = ((long long)(time.tv_sec))*1000+time.tv_usec/1000;
    return curTime;
}
#endif //CROSSPLATFORMPLAYER_LOG_H
